package com.bluesky.plum.richdomain.annotation.parameter;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import com.bluesky.plum.richdomain.FieldType;
import com.bluesky.plum.richdomain.annotation.FieldEditorDisplayStyle;

/**
 * common attributes
 * 
 * @author HZ00260
 * 
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
public @interface OUMParameter {
	String name() default "";

	String caption() default "";

	String desc() default "";

	FieldType fieldType() default FieldType.Undefined;

	// default value
	String defaultStringValue() default "";

	int defaultIntegerValue() default 0;

	String defaultDateValue() default "";

	boolean defaultBooleanValue() default false;

	/**
	 * select from options or create a new instance
	 */
	boolean newInstance() default false;

	FieldEditorDisplayStyle displayStyle() default FieldEditorDisplayStyle.Auto;

	/**
	 * a parameter could reference to a entity field.
	 * 
	 * @return
	 */
	Class refClass() default Object.class;

	/**
	 * if empty, means same name.
	 * 
	 * @return
	 */
	String refField() default "";
}
